<div class="form wide">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'text-form',
	'enableAjaxValidation'=>false,
    'clientOptions'=>array(
        'validateOnSubmit'=>true,
        'beforeValidate'=>'js:function(form){
            if (typeof contentEditor !== "undefined")
                $("#Text_content").val(contentEditor.getCode());
            else if (typeof tinyMCE !== "undefined")
                $("#Text_content").val(tinyMCE.activeEditor.getContent());
            return true;
        }'
    ),
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

    <?php if (! $model->IsNewRecord) echo $form->hiddenField($model, "id") ; ?>
	<div class="row">
        <?php $this->widget('Core.components.tinymce.ETinyMce', array(
            'model'=>$model, 
            'attribute'=>'content', 
            'editorTemplate'=>'full',
            'options'=>array(
                'theme_advanced_buttons1'=>'cut,copy,paste,pastetext,pasteword,|,search,replace,|,undo,redo,|,removeformat,cleanup,|,spellchecker,|,visualaid,visualchars,|,ltr,rtl,|,code,preview,fullscreen'
            ),
            'width'=>'750px',
            'height'=>'350px',
        )); ?>
        <?php echo $form->error($model,'content'); ?>
    </div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->